from google.appengine.ext import db

class Poll(db.Model):
  owner = db.UserProperty()
  question = db.StringProperty(required=True)
  start_date = db.DateTimeProperty()
  end_date = db.DateTimeProperty()
  visible = db.BooleanProperty()

class Choice(db.Model):
  name = db.StringProperty()
  poll = db.ReferenceProperty(Poll)
  
class Vote(db.Model):
  owner = db.UserProperty()
  choice = db.ReferenceProperty(Choice)
  poll = db.ReferenceProperty(Poll)
